<!DOCTYPE html>
<html lang="zh-CN">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta http-equiv="Content-Language" content="zh-CN" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <title>确认订单 - VANCL 凡客诚品</title>
        <link rel="shortcut icon" type="image/x-icon" href="http://i.vanclimg.com/common/favicon/favicon.ico" type="image/x-icon" />
        <link rel="Stylesheet" type="text/css" charset="utf-8" href="/homes/carts/Css/confirm.css" />
 		<script src="/homes/goods/Scripts/require-jquery-1.8.3.js"></script>

        <script type="text/javascript" charset="utf-8" src="/homes/carts/Scripts/js.js"></script>
        <!--[if IE 6]>
        <script type="text/javascript">document.execCommand("BackgroundImageCache", false, true);</script>
        <![endif]-->
        <script type="text/javascript">
            var staticResourcePath = { "img": "http://i.vanclimg.com/", "sslimg": "https://ssl.vanclimg.com/" };
            var staticSitePath ={"isOpened":"false","checkOut":"https://shopping.vancl.com/checkout"};
        </script>
        
    <link rel="stylesheet" type="text/css" charset="utf-8" href="/homes/carts/Css/confirm.css" />
		<link rel="stylesheet" href="/homes/bootstrap/css/bootstrap.min.css">
		<link rel="stylesheet" href="/homes/bootstrap/css/bootstrap-theme.min.css">
		<script type="text/javascript" src="/homes/bootstrap/js/jquery.js"></script>
		<script type="text/javascript" src="/homes/bootstrap/js/bootstrap.min.js"></script>

    </head>
    <body class="mycart" id="content">
        <div class="shade"></div>
        <div id="wrapper">
            <div id="header" class="clearfix">
                    <a class="logo" href="http://www.vancl.com/" title="凡客诚品" target="_blank">
                        <img alt="凡客诚品"  src ="/homes/carts/Picture/vancl-logo.png" />
                    </a>
                    <div class="help-center">
                        <a href="http://help.vancl.com/" target="_blank">帮助中心</a>
                    </div>
            </div>
            
            
           <div id="location">
		               
		    <em>2.填写核对信息单</em>
		    <span>3.成功提交订单</span>
		    <span>完成</span>

           </div> 
			<div class='clearfix'></div>
			
			<div class="cart-top" style="padding-top:10px;">
		        <!-- 2015.07.31 shopping改版 -->
		      <form action="/order/confirm" method="post">
              <div class="table-responsive bottommargin">

		        <h2>确认订单 <span class='btn btn-danger pull-right' style='padding-left:10px;height:30px;width:100px' type='submit' data-toggle="modal" data-target="#modal">添加收货地址</span></h2>
		         @foreach($user->address as $k=>$v)
                  <div class="address col-md-3" style="height:150px;margin-right:20px" aid="{{$v->id}}">
                    <h5>姓名: {{$v->name}}</h5><br>
                    <p style="margin-bottom:0px;">手机号:{{$v->phone}}</p><br>
                    <p style="margin-bottom:0px;">详细地址: {{getAreaNameById($v->sheng)}}-{{getAreaNameById($v->shi)}}-{{getAreaNameById($v->xian)}} {{$v->detail}}</p>
                  </div>
                  @endforeach
				 <div class="clearfix"></div>
                  <h3 style="padding-top:15px">支付方式</h3>
                  <ul class="list-inline">
                    <li><input type="radio" name="pay" value="alipay">支付宝</li>
                    <li><input type="radio" name="pay" value="weipay">微信支付</li>
                  </ul> 
                  {{csrf_field()}}
                  <input type="hidden" name="order_id" value="{{$order->id}}">
                  <input type="hidden" name="address" value="">
                  <div id="submit"><button class="btn btn-danger pull-right">提交</button></div>
              </div>  
            </form>


		    </div>

			<div class='clearfix'></div>
            <div id="content">
                
			{{-- 模态框以下 start --}}
			<div id="modal" class="modal fade" tabindex="-1" role="dialog">
			  <div class="modal-dialog" role="document">
			    <div class="modal-content">
			      <div class="modal-header">
			        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
			        <h4 class="modal-title">添加收货地址</h4>
			      </div>
			      <div class="modal-body">
			        <form method="post" id="form" action="/address/insert">
			          <div class="form-group">
			            <label for="exampleInputEmail1">姓名</label>
			            <input type="text" class="form-control" name="name" id="exampleInputEmail1" placeholder="">
			          </div>
			          <div class="form-group">
			            <label for="exampleInputPassword1">手机号</label>
			            <input type="text" class="form-control" name="phone" id="exampleInputPassword1" placeholder="">
			          </div>
			          
			          <div class="form-group">
			            <label for="exampleInputPassword1">地址</label>
			            <div class="clearfix"></div>
			            <div class="col-md-4">
			                <select name="sheng" id="" class="form-control">
			                    <option value="">请选择</option>
			                </select>
			            </div>
			            <div class="col-md-4">
			                <select name="shi" id="" class="form-control">
			                    <option value="">请选择</option>
			                </select>
			            </div>
			            <div class="col-md-4">
			                <select name="xian" id="" class="form-control">
			                    <option value="">请选择</option>
			                </select>
			            </div>
			          </div>
			          <div class="clearfix"></div>
			            
			          <div class="form-group">
			            <label for="exampleInputPassword1">详细地址</label>
			            <textarea name="detail" class="form-control" id=""></textarea>
			          </div>


			          <div class="checkbox">
			            <label>
			              {{csrf_field()}}
			              <input type="checkbox" name="isdefault" value="1"> 是否默认
			            </label>
			          </div>
			        </form>

			        <script>
			            function init() {
			                $.get('/area?pid=0', {}, function(data){
			                    for(var i=0;i<data.length;i++){
			                        $('<option value="'+data[i]['areaid']+'">'+data[i]['areaname']+'</option>').appendTo('select[name=sheng]');
			                    }
			                },'json')
			            }

			            init();

			            $('select[name=sheng]').change(function(){
			                $('select[name=shi]').html('<option value="">请选择</option>');
			     //            $('select[name=xian]').html('<option value="">请选择</option>');
							 var id = $(this).val();
			                $.get('/area?pid='+id, {}, function(data){
			                    for(var i=0;i<data.length;i++){
			                        $('<option value="'+data[i]['areaid']+'">'+data[i]['areaname']+'</option>').appendTo('select[name=shi]');
			                    }
			                },'json')
			            });

			            $('select[name=shi]').change(function(){
			                $('select[name=xian]').html('<option value="">请选择</option>');
			                //获取当前省的id
			                var id = $(this).val();
			                //
			                $.get('/area?pid='+id, {}, function(data){
			                    for(var i=0;i<data.length;i++){
			                        $('<option value="'+data[i]['areaid']+'">'+data[i]['areaname']+'</option>').appendTo('select[name=xian]');
			                    }
			                },'json')
			            });


			        </script>
			      </div>
			      <div class="modal-footer">
			        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
			        <button type="button" class="btn btn-danger" onclick="$('#form').submit()">添加</button>
			      </div>
			    </div>
			  </div>
			</div>

			@if(session('success'))
			<div id="remind" class="modal fade" tabindex="-1" role="dialog">
			  <div class="modal-dialog" role="document">
			    <div class="modal-content">
			      <div class="modal-header">
			        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
			        <h4 class="modal-title">温馨提示</h4>
			      </div>
			      <div class="modal-body">
			        {{session('success')}} 
			      </div>
			    </div>
			  </div>
			</div>
			<script>
			$(function(){
			  $('#remind').modal();
			})
			</script>
			@endif

			{{-- 模态框以下 end --}}
    <style>
	      .address{
	        border:solid 1px #ddd;
	      }
	      #content .active{
	        border:solid 1px #B80000;
	      }
	</style>
    <script>
        $('.address').click(function(){
        $('.address').removeClass('active');
        $(this).addClass('active');
        //通过点击来获取地址的id
        var aid = $(this).attr('aid');
        //将该id的值 赋值给隐藏域
        $('input[name=address]').val(aid);
      })
    </script>


            </div>
            <div id="footer">
                    <p class="copyrights">Copyright 2007 - 2017 vancl.com All Rights Reserved 京ICP证100557号 京公网安备11010102000579号 出版物经营许可证新出发京批字第直110138号</p>
                    <p class="certs">
                        <a class="ectrustprc" title="中国电子商务诚信单位" href="http://www.ectrustprc.org.cn/seal/splash/1000020.htm" target="_blank">
                            <img alt="中国电子商务诚信单位" src="/homes/carts/Picture/cert-redlogo.gif" />
                        </a>
                        <span class="costumeorg" title="中国服装协会会员单位">
                            <img alt="中国服装协会会员单位" src="/homes/carts/Picture/cert-costumeorg.gif" />
                        </span>
                        <a class="online315" href="http://www.315online.com.cn/member/315090053.html" title="网上交易保障中心" target="_blank">
                            <img alt="网上交易保障中心" src="/homes/carts/Picture/cert-wsjybzzx.gif" />
                        </a>
                    </p>
            </div>
        </div>       
        
    <script type="text/javascript" src="/homes/carts/Scripts/js.js"></script>
    <script type="text/javascript" src="/homes/carts/Scripts/js.js"></script>
    <script type="text/javascript" src="/homes/carts/Scripts/js.js"></script>
    <script type="text/javascript">
        var google_conversion_id = 1045274787;
        var google_conversion_language = "en";
        var google_conversion_format = "3";
        var google_conversion_color = "666666";
        var google_conversion_label = "VFEPCI3L4QEQo8G28gM";
        var google_conversion_value = 0;
    </script>
    <script type="text/javascript" src="homes/carts/Scripts/js.js"></script>
    <noscript>
        <div style="display: inline;"><img height="1" width="1" style="border-style: none;" alt="" src="/homes/carts/Picture/d09d9b5426cb474588db41f15cf2b92f.gif" /></div>
    </noscript>
    <iframe style="display:none" src="../../MediaV.htm"></iframe>
    <iframe id="vizury" style="display:none" src="http://page.vanclimg.com/mediav/vizuryiframe.htm"></iframe>
    <iframe id="MediaV" style="display:none" src=""></iframe> 
    <iframe style="display: none" src="http://page.vanclimg.com/dsp/iframe.html?from=shopping&pagetype=shopping"></iframe>

        <script type="text/javascript" src="/homes/carts/Scripts/js.js"></script>
	
    </body>
</html>